package com.example.restaurant.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.restaurant.controller.form.ModifyDishNumberByStatusForm;
import com.example.restaurant.model.OrderInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.restaurant.service.dto.GetOrderOperateDto;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 订单详情表 Mapper 接口
 * </p>
 *
 * @author x
 * @since 2022-09-29
 */
public interface OrderInfoMapper extends BaseMapper<OrderInfo> {
    @Select("select order_number,dish_number,dish_price,dish_img,dish_name from order_info where dish_number=#{number}")
    IPage<OrderInfo> getOrder(Page<OrderInfo> page, @Param("number") String number);
    @Update("update order_info set dish_number=#{form.number} where order_number=#{form.orderNumber} and dish_id=#{form.dishId}")
    int modifyOrderInfo(@Param("form") ModifyDishNumberByStatusForm form);
}
